package com.market.web.model;

import java.util.ArrayList;
import java.util.List;

import javax.faces.model.SelectItem;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.market.domain.Faq;

@Component("faqModel")
@Scope("session")
public class FaqModel extends GenericModel<Faq> {

//	@Override
	public Faq getNewObject() {
		Faq faq = new Faq();
		faq.setIsNew(true);
		return faq;
	}
	
	public List<SelectItem> getAvailableTypes(){
		List<SelectItem> types= new ArrayList<SelectItem>();
		for(Faq.TYPE type:Faq.TYPE.values()){
			types.add(new SelectItem(type, type.getLabel()));
		}
		return types;
	}
}
